package com.gzz.orchid.main.facade.rsocket;

import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Flux;

@Component
public class NotificationClient {

    private final RSocketRequester rSocketRequester;

    public NotificationClient(RSocketRequester rSocketRequester) {
        this.rSocketRequester = rSocketRequester;
    }

    public Flux<String> fetchNotifications() {
        return rSocketRequester
                .route("notifications")
                .retrieveFlux(String.class);
    }
}

